#include <stdio.h>
#include <string.h>

void reverse(char str[])
{
    int length = strlen(str);
    int left = 0;
    int right = length - 1;

    while(left < right)
    {
        char temp = str[left];
        str[left] = str[right];
        str[right] = temp;
        left++;
        right--;
    }
}

int main()
{
    char text[100];

    printf("请输入一个字符串：\n");
    fgets(text, sizeof(text), stdin);
    text[strcspn(text, '\n')] = '\0';
    printf("转换前的字符串：%s", text);
    reverse(text);
    printf("转换后的字符串：%s", text);
    return 0;
}